$(function(){
    $("#car_datagrid").datagrid({
        fit:true,
        url:"/car/list",
        fitColumns:true,
        striped:true,
        pagination:true,
        singleSelect:true,
        checkOnSelect:true,
        rownumbers:true,
        columns:[[
            {field:'id',title:'编号', hidden:true},
            {field:'checkbox',checkbox:true,tilte:'选中',width:100},
            {field:'carname',title:'车俩品牌',align:'center',width:100},
            {field:'cartype',title:'车辆型号',align:'center',width:100},
            {field:'displacement',title:'排气量/L',align:'center',width:100},
            {field:'marketval',title:'排气量/L',align:'center',width:100},
            {field:'carsizeId',title:'分类',align:'center',width:100,formatter:function(value){
                if(value==1){
                    return "小型"
                }else if(value==2){
                    return "中型"
                }else if(value==3){
                    return "大型"
                }
            }},
            {field:'sort',title:'车载大小',align:'center',width:100,formatter:function(value){
            if(value){
                return "<p style='color: #00bbee'>载人</p>";
            }else{
                return "<p style='color: #e68900'>载物</p>";
            }
            }},
        ]]
    })
})